import time
def bubble_sort(array: list) -> list:
    n = len(array)
    for i in range(n):
        for j in range(0, n - i - 1):
            if array[j] > array[j + 1]:
                array[j], array[j + 1] = array[j + 1], array[j]
    return array

for i in ["m1_sorted", "m2_reverse", "m3_shuffle"]:
    m = []
    with open("{i}.txt".format(i=i), 'r') as f:
        for line in f:
            m.append(int(line))
    start = time.time()
    bubble_sort(m)
    end = time.time()
    print(f"{i} {(end - start) * 1000} milliseconds")